local skel = fk.CreateSkill {
  name = "emo__zhuojin",
}

skel:addEffect(fk.EventPhaseStart, {
  anim_type = "support",
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(skel.name) and target.phase == Player.Start and player:getHandcardNum() > 1
  end,
  on_cost = function(self, event, target, player, data)
    local room = player.room
    local success, dat = room:askToUseActiveSkill(player, {
      skill_name = "emo__zhuojin_active", prompt = "#emo__zhuojin-card", extra_data = {bypass_times = true}
    })
    if success and dat then
      event:setCostData(self, dat)
      return true
    end
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    local dat = event:getCostData(self)
    room:throwCard(dat.cards, skel.name, player, player)
    local card = Fk:cloneCard(dat.interaction)
    card.skillName = skel.name
    local use = {
      from = player,
      tos = dat.targets,
      card = card,
      extraUse = true,
    }
    if use.card:isCommonTrick() then
      room:addTableMark(player, "emo__zhuojin_used", use.card.name)
    else
      room:setPlayerMark(player, "emo__zhuojin_slash-round", 1)
    end
    room:useCard(use)
  end,
})

Fk:loadTranslationTable{
  ["emo__zhuojin"] = "捉襟",
  [":emo__zhuojin"] = "任意角色的准备阶段，你可以弃置两张手牌，并视为使用一张普通【杀】或任意普通锦囊牌（【杀】每轮限一次，锦囊牌每牌名限一次）。",

  ["#emo__zhuojin-card"] = "捉襟：可以弃置两张手牌，并视为使用一张普通【杀】或任意普通锦囊牌",
  ["emo__zhuojin_active"] = "捉襟",
}


return skel
